import 'package:flustars_flutter3/flustars_flutter3.dart';
import 'package:flutter/material.dart';
import 'package:ls_work/a_yyt/models/policy_warning_entity.dart';
import 'package:ls_work/res/gaps.dart';
import 'package:ls_work/res/styles.dart';

class PolicyDealCell extends StatelessWidget {
  final PolicyWarningInfo? info;
  PolicyDealCell({Key? key, this.info});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(10),
      width: double.infinity,
      margin: EdgeInsets.only(top: 15),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Text(
                '${info?.customerName ?? ''}',
                style: TextStyles.textDark18,
              ),
              Gaps.hGap10,
              Expanded(
                child: Text(
                  '${info?.floorNo??""}${info?.roomNo??""}',
                  style: TextStyles.textGray14,
                ),
              ),
            ],
          ),
          Gaps.vGap12,
          Gaps.vGap12,
          Text(
            '首次呼叫： ${DateUtil.formatDateStr(info?.createdDate??"", format: 'MM-dd HH:mm:ss')}',
            style: TextStyles.textGray18,
          ),
          Gaps.vGap12,
          Text.rich(TextSpan(children: [
            TextSpan(
              text: '本次报警 ',
              style: TextStyles.textGray18,
            ),
            TextSpan(
              text: '${info?.callTimes??""}',
              style: TextStyle(fontSize: 18, color: Colors.red),
            ),
            TextSpan(
              text: ' 次呼叫',
              style: TextStyles.textGray18,
            ),
          ])),
          Gaps.vGap12,
          Text(
            '首次应答： ${DateUtil.formatDateStr(info?.answerTime??"", format: 'MM-dd HH:mm:ss')}',
            style: TextStyles.textGray18,
          ),
          Gaps.vGap12,
          Text(
            '处理时间： ${DateUtil.formatDateStr(info?.dealTime??"", format: 'MM-dd HH:mm:ss')}',
            style: TextStyles.textGray18,
          ),
          Gaps.vGap12,
          Text(
            '处理时长： ${info?.handlingTime??""}',
            style: TextStyles.textGray18,
          ),
          Gaps.vGap10,
          Gaps.vGap10,
        ],
      ),
    );
  }
}
